﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="OrganizeYourSearch.WebBrowserControl"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480">
    <UserControl.CommandBindings>
        <CommandBinding Command="BrowseBack" CanExecute="BrowseBack_CanExecute" Executed="BrowseBack_Executed"></CommandBinding>
        <CommandBinding Command="BrowseForward" CanExecute="BrowseForward_CanExecute" Executed="BrowseBack_Executed"></CommandBinding>
        <CommandBinding Command="Refresh" CanExecute="Refresh_CanExecute" Executed="Refresh_Executed"></CommandBinding>
        <CommandBinding Command="BrowseStop" CanExecute="Stop_CanExecute" Executed="Stop_Executed"></CommandBinding>
    </UserControl.CommandBindings>
    
	<UserControl.Resources>
		<Style x:Key="URLtextBox" TargetType="{x:Type TextBox}">
			<Setter Property="Background" Value="{DynamicResource TextBoxBackgroundBrush}"/>
			<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}"/>
			<Setter Property="Template" Value="{DynamicResource URLtextbox}"/>
			<Setter Property="Foreground" Value="#FF52002D"/>
			<Style.Triggers>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}"/>
					<Setter Property="Background" Value="{DynamicResource TextBoxDisabledBackgroundBrush}"/>
					<Setter Property="Foreground" Value="#FFA0A0A0"/>
				</Trigger>
				<Trigger Property="IsMouseOver" Value="True">
					<Setter Property="Background" Value="{DynamicResource TextBoxHoverBackgroundBrush}"/>
					<Setter Property="BorderBrush" Value="{DynamicResource TextBoxHoverBorderBrush}"/>
				</Trigger>
			</Style.Triggers>
		</Style>
		<ControlTemplate x:Key="URLtextbox" TargetType="{x:Type TextBox}">
			<DockPanel Height="30">
				<Image x:Name="tbGlobe" HorizontalAlignment="Stretch" Margin="0,0,5,0" Source="Images/WebX32.png" Stretch="Fill" Width="24" Height="24"/>
				<TextBox x:Name="tbURL" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="http://" VerticalAlignment="Stretch" FontSize="16"
				/>
			</DockPanel>
		</ControlTemplate>
	</UserControl.Resources>

	<DockPanel x:Name="LayoutRoot">
		<DockPanel DockPanel.Dock="Top" Height="32" OpacityMask="#FFB69F9F">
			<Button x:Name="btnLeftNav" Width="30" Height="30" Margin="5,0,0,0" Command="BrowseBack">
				<Image HorizontalAlignment="Left" Height="24" Margin="0" Source="../Images/navLeftX24.png" Stretch="Fill" Width="24" d:LayoutOverrides="Height"/>
			</Button>
			<Button x:Name="btnRightNav" Width="30" Height="30" Margin="0" Command="BrowseForward">
				<Image Height="24" Source="../Images/navRightX24.png" Stretch="Fill" Width="24"/>
			</Button>
			<Image Source="../Images/WebX32.png" Stretch="Fill" Width="30" Height="30" Margin="5,0"/>
			<Button x:Name="btnStop" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,1,5,1" DockPanel.Dock="Right"
                    Command="BrowseStop">
				<Image Source="../Images/stopx32.png" Stretch="Fill" Width="23" Height="23" />
			</Button>
			<Button x:Name="btnRefresh" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,1" DockPanel.Dock="Right"
                    Command="Refresh">
				<Image Source="../Images/view-refresh.ico" Stretch="Fill" Width="23" Height="23"/>
			</Button>
			<TextBox x:Name="tbURLbox"  Height="30" FontSize="16" AcceptsReturn="False" 
                   />
		</DockPanel>
        <WebBrowser x:Name="wbBrowser" Margin="5">
        </WebBrowser>
    </DockPanel>
</UserControl>